/*
 * @lc app=leetcode.cn id=35 lang=typescript
 *
 * [35] 搜索插入位置
 */

// @lc code=start
function searchInsert(nums: number[], target: number): number {
    for (let index = 0; index < nums.length; index++) {
        const element = nums[index];
        if (element >= target) {
            return index;
        }
    }
    return nums.length;
}
// @lc code=end
